package ch.usi.inf.pf2.cell;

import junit.framework.TestCase;
import ch.usi.inf.pf2.cell.Data;
import ch.usi.inf.pf2.cell.Formula;
import ch.usi.inf.pf2.cell.Text;

/**
 * @author Lorenzo Baracchi
 */
public class TestFormula extends TestCase
{
    public void testEqualsTextFalse()
    {
	   Formula v1 = new Formula("=A1+B2");
	   Formula v2 = new Formula("=A1+A2");
	   assertEquals(false, v1.equals(v2));
    }

    public void testEqualsTextTrue()
    {
	   Formula v1 = new Formula("=A1+B2");
	   Formula v2 = new Formula("=A1+B2");
	   assertEquals(true, v1.equals(v2));
    }

    public void testEqualsDataTrue()
    {
	   Formula v1 = new Formula("=A1+B2");
	   Data v2 = new Formula("=A1+B2");
	   assertEquals(true, v1.equals(v2));
    }

    public void testEqualsDataFalse()
    {
	   Formula v1 = new Formula("=A1+B2");
	   Data v2 = new Formula("=A1+A2");
	   assertEquals(false, v1.equals(v2));
    }

    public void testEqualsDataNotFormula()
    {
	   Formula v1 = new Formula("=A1+B2");
	   Data v2 = new Text("=A1+A2");
	   assertEquals(false, v1.equals(v2));
    }
}
